//
//  Consts.swift
//  SwiftyDSA
//
//  Created by Archer on 2018/8/5.
//  Copyright © 2018年 Archer. All rights reserved.
//

import Foundation

/// 未找到标识
public let NotFound = -1

public func DSABenchmark(_ body: () -> Void, _ done: (TimeInterval) -> Void) {
    var t0 = timeval()
    var t1 = timeval()
    gettimeofday(&t0, nil)
    body()
    gettimeofday(&t1, nil)
    let costs = Double((t1.tv_sec - t0.tv_sec)) * 1e3 +  Double((t1.tv_usec - t0.tv_usec)) * 1e-3
    done(costs)
}

func debugFatalError(_ message: String = "") -> Never {
    #if DEBUG
    fatalError(message)
    #else
    print(msg)
    #endif
}

/// @discussion
/// I don't really like programming in iOS
/// if somebody, I'm saying you are looking
/// my code, and you feel ok, please take me
/// to do other pragramming job(a.k.a大神带我飞)
